const app = getApp()
import http from '../../../utils/http'
Page({
  data: {
    orderId:null,
    content:"",
    selectFrom:['接单员','用户','代取平台'],
    index1: 0,
  },
  onLoad:function(options) {
    this.setData({
      orderId: options.orderId
    })
  },
  bindPickerChange1: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index1: e.detail.value
    })
  },
  addQuestion: function(){
    var that = this
    http({
      url: '/feedback/add',
      data: {
          orderId:that.data.orderId,
          content:that.data.content,
          // type:this.data.index1
      },
      method: 'POST',
      success: (res) => {
        wx.showModal({
          title: '提示',
          content: '反馈成功，稍后会有客服联系你',
          success(res) {
            if (res.confirm) {
              wx.switchTab({url:'../../me/me'});  
            } else if (res.cancel) {
              
            }
          }
        })
      },fail: (res) => {
        wx.showModal({
          title: '提示',
          content: '服务器连接失败，请检查网络',
        })
      }
    })
  },
  //无用函数
  bindinput: function () {}
})